var boxy = null;
var opts = {
	title:'<span style="font-size:18px">&nbsp;&nbsp;</span>',
	closeable:true,
	show:true,
	modal:true,
	afterHide:function(){$("#ajaxpop").remove()}
};

var Admin = {
	remove:function(url,message,callback){
		Boxy.confirm(message, function() {
			$('#progress').show();
			$.ajax({
				complete:function(request){jQuery('#progress').hide()}, 
				data:null, 
				dataType:'json',
				success:function(request){
					if ( typeof(callback)!='undefined' )
					{
						callback(request);
					}else{
						window.location.reload();
					}
				},
				type:'get',
				url:url
			});
		}, {title: "确认提示"});
	},
	//ajax 请求
	ajaxRequest:function(opt,data){	
		if( typeof(data)=='undefined' ) data = null;
		if( typeof(opt.url)=='undefined' ) opt.url = BASE_URL;
		if( typeof(opt.method)=='undefined' ) opt.method = 'POST';
		if( typeof(opt.dataType)=='undefined' ) opt.dataType = 'html';
		if( typeof(opt.cache)=='undefined' ) opt.cache = false;
		if( typeof(data)=='undefined' ) data = null;
		jQuery('#progress').show();
		
		jQuery.ajax(	
		{
			complete:function(request){jQuery('#progress').hide()}, 
			data:data, 
			dataType:opt.dataType,
			cache:opt.cache,
			success:function(request){
				 if( typeof(opt.callback)!='undefined' ) opt.callback(request);
				 else alert(request);
			}, 
			type:opt.method, 
			url:opt.url
		}); 
	}
};


